<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>编辑商品</title>
	<hdjs />
	<script type="text/javascript">
	$(function(){
		$('form').validate({{$validate}});
	})
	</script>
	<js file="__PUBLIC__/js/mod.base.js,__PUBLIC__/js/mod.article.js,,__PUBLIC__/js/mod.goods.js" />
	<css file='__PUBLIC__/css/mod.base.css,__PUBLIC__/css/mod.article.css' />
	<script type='text/javascript'>
		// 删除图集
		var ajaxDelPicUrl = "{:U('Goods/ajax_del_pic')}";
		// 删除附件
		var ajaxDelAttachmentUrl = "{:U('Goods/ajax_del_attachment')}";
	</script>
</head>
<body>
	<form action="" method="post" enctype='multipart/form-data' class='hd-form' name="form">
		

			<if condition='$curCatType neq 4'>
			<div class="hd-menu-list">
				<ul>
					<li>
						<a href="{:U('Goods/index',array('goodscat_cid'=>$_GET['goodscat_cid'],'verifystate'=>$_GET['verifystate']))}" >商品列表</a>
					</li>
					<li class='active'>
						<a href="javascript:;" >编辑商品</a>
					</li>
					
				</ul>
			</div>
			</if>

			<div class="hd-title-header">温馨提示</div>
			<div class="help">
			    <ul>
			        <li>
			          {$curCname} 编辑商品
			        </li>
			    </ul>
			</div>
			<div class="right_content">
				<div class="hd-tab">
					<ul class="hd-tab-menu">
						<li lab='base' class="active">
							<a href="#">基本信息</a>
						</li>
						<if condition='$curCatType neq 4'>
							<li lab='pic'>
								<a href="#">图集信息</a>
							</li>
						</if>
					</ul>
					<div class="hd-tab-content">
						<div lab='base' class='hd-table-area'>
							<table class='hd-table hd-table-form hd-form'>
								<tbody>
									<tr>
										<th class="hd-w100">
											商品分类
											<span class="star">*</span>
										</th>
										<td>
											<select name="goodscate_cid" >
												<option value="0">请选择分类</option>
												<foreach name='goodscate' item='v'>
												<option value="{$v.cid}" <if condition="$v['cid'] eq $_GET['goodscate_cid']">selected='selected'</if>>{$v._name}</option>
												</foreach>
											</select>
										</td>
									</tr>
									<tr>
										<th>
											商品名称
											<span class="star">*</span>
										</th>
										<td>

											<input type="text" name="goods_name" class='hd-w300'  value="{$data.goods_name}" />	

										</td>
									</tr>
									<tr>
										<th>
											副标题
											<span class="star">*</span>
										</th>
										<td>

											<input type="text" name="sub_name" class='hd-w300'  value="{$data.sub_name}" />	

										</td>
									</tr>
									<tr>
										<th>
											商品型号
											<span class="star">*</span>
										</th>
										<td>
											<input type="text" name="goods_model" class='hd-w300' value="{$data.goods_model}"/>	
										</td>
									</tr>
									<tr>
										<th >
											关键字
										</th>
										<td>
											<textarea name="keywords" class='hd-w500 hd-h100'>{$data.keywords}</textarea>
										</td>
									</tr>
									<tr>
										<th >
										描述
										
										</th>
										<td>
											<textarea name="description" class='hd-w500 hd-h100'>{$data.description}</textarea>
										</td>
									</tr>
								
									<tr >
										<th>
										排序
										<span class="star">*</span>
										</th>
										<td>
											<input type="text" name="sort" class='hd-w200' value="{$data.sort}" />	
										</td>
									</tr>

									<tr>
										<th>
										浏览次数
										<span class="star">*</span>
										</th>
										<td>
											<input type="text" name="click" class='hd-w200' value="{$data.click}" />	
										</td>
									</tr>

									<tr>
										<th>
										发布时间
										
										</th>
										<td>
											<input id='addtime' type="text" name="addtime" class='hd-w200' />	
											<script>
												$('#addtime').calendar({
													format : 'yyyy-MM-dd'
												});
											</script>
										</td>
									</tr>

									<tr>
										<th>
											审核
											<span class="star">*</span>
										</th>
										<td>
											<label >
												<input name="verifystate" type="radio"  value="1" <if condition='$data["verifystate"] eq 1'> checked='checked'</if> />
												审核中
											</label>&nbsp;&nbsp;
											<label >
												<input checked="checked" name="verifystate" type="radio" value="2" <if condition='$data["verifystate"] eq 2'> checked='checked'</if>/>
												通过
											</label>
										</td>
									</tr>
									<tr>
										<th>
											属性
										</th>
										<td>
											<foreach name='Think.Config.goodsflag' item='v'>
												<label >
													<input <if condition="strchr($data['flag'],$v)">checked='checked'</if>  name="flag[]" type="checkbox"  value="{$v}" />
													{$v}({$key})
												</label>&nbsp;&nbsp;
											</foreach>
										</td>
									</tr>
									<tr>
										<th>
											数量
											<span class="star">*</span>
										</th>
										<td>

											<input type="text" name="goods_num" class='hd-w200'  value="{$data.goods_num}" />	

										</td>
									</tr>
									<tr>
										<th>
											重量g
											<span class="star">*</span>
										</th>
										<td>

											<input type="text" name="goods_weight" class='hd-w200'  value="{$data.goods_weight}" />	

										</td>
									</tr>
									<tr>
										<th>
											本店价格
											<span class="star">*</span>
										</th>
										<td>

											<input type="text" name="shop_price" class='hd-w200'  value="{$data.shop_price}"/>	
										</td>
									</tr>
									<tr>
										<th>
											市场价格
											<span class="star">*</span>
										</th>
										<td>

											<input type="text" name="market_price" class='hd-w200'  value="{$data.market_price}"/>	
										</td>
									</tr>
								
									<tr>
										<th>
											是否促销
											
										</th>
										<td>

											<label>
												<input type="checkbox" name="is_promote"  value="1" <if condition='$data["is_promote"] eq 1'> checked='checked'</if> />
												是
											</label>

										</td>
									</tr>
									<tr class="promote">
										<th>
											促销价格
									
										</th>
										<td>

											<input type="text" name="promote_price" class='hd-w200' <if condition='!$data["is_promote"]'>disabled='disabled'</if> value="{$data.promote_price}" />	

										</td>
									</tr>
									<tr class="promote">
										<th>
											促销时间
											
										</th>
										<td>
			
											<input type="text" name="promote_start"  id='promote_start' readonly="readonly" class="hd-w80" <if condition='!$data["is_promote"]'>disabled='disabled'</if> 
											<if condition='$data["promote_start"]'>
												value="{$data.promote_start|date='Y-m-d',###}"</if>/>&nbsp;&nbsp;-&nbsp;&nbsp;
											<input type="text" name="promote_end"  id='promote_end'readonly="readonly" class="hd-w80"  <if condition='!$data["is_promote"]'>disabled='disabled'</if>  
											<if condition='$data["promote_end"]'>value="{$data.promote_end|date='Y-m-d',###}</if>"/>
											<script>
												$('#promote_start').calendar({
													format : 'yyyy-MM-dd'
												});
												$('#promote_end').calendar({
													format : 'yyyy-MM-dd'
												});
											</script>
										</td>
									</tr>
									<tr>
										<th>
											是否预售
											
										</th>
										<td>

											<label>
												<input type="checkbox" name="is_deposit" value="1"  <if condition='$data["is_deposit"] eq 1'> checked='checked'</if>/>
												是
											</label>

										</td>
									</tr>
									<tr class="deposit">
										<th>
											预售定金
											
										</th>
										<td>

											<input type="text" name="deposit_price" class='hd-w200' <if condition='!$data["is_deposit"]'>disabled='disabled'</if>value="{$data.deposit_price}" />	

										</td>
									</tr>
									<tr class="deposit">
										<th>
											预售时间
											
										</th>
										<td>
			
											<input type="text" name="deposit_start"  id='deposit_start' readonly="readonly" class="hd-w80"  <if condition='!$data["is_deposit"]'>disabled='disabled'</if>  <if condition='$data["deposit_start"]'>value="{$data.deposit_start|date='Y-m-d',###}"</if> />&nbsp;&nbsp;-&nbsp;&nbsp;
											<input type="text" name="deposit_end"  id='deposit_end'readonly="readonly" class="hd-w80" <if condition='!$data["is_deposit"]'>disabled='disabled'</if> <if condition='$data["deposit_end"]'>value="{$data.deposit_end|date='Y-m-d',###}"</if> />
											<script>
												$('#deposit_start').calendar({
													format : 'yyyy-MM-dd'
												});
												$('#deposit_end').calendar({
													format : 'yyyy-MM-dd'
												});
											</script>
										</td>
									</tr>
									<tr>
										<th>
											图片
										</th>
										<td>
											<input type="file" name='goods_original'/>
											<if condition='$data["goods_original"]'>
											<br />
											<img src="__ROOT__/{$data.goods_original}" alt="" width="100" />
											</if>
										</td>
									</tr>
									
									<tr>
										<th>
											商品详情
										</th>
										<td>
											<?php echo keditor(array('name'=>'goods_desc','content'=>$data['goods_desc'])) ?>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div lab='pic' class='hd-tab-area' id='pic'>

							<ul class='one_pic'>
								<foreach name='data.pics' item='p'>
									<li>
										<img src="{$p.big}" alt=""  width="100" />
									
										<span aid="{$p.goods_gid}" id="{$p.id}" onclick='del_img(this)'>×</span>
									</li>
								</foreach>
							</ul>

							<table class='hd-table hd-table-form hd-form'>
								<tbody>
				
									<tr>
										<th class="hd-w100"><span class="hand" onclick="add_pic(this)">[+]</span></th>
										<td ><input type="file" name="img[]" class="input noborder"></td>
									</tr>
									
								</tbody>
							</table>
						</div>
					</div>
				</div>
			</div>
			<input type="hidden" name="gid" value='{$data.gid}' />
			<input type="submit" class='hd-btn hd-btn-sm' value="编辑" />
			<input type="button" class="hd-btn hd-btn-sm" onclick="location.href='{:U('Goods/index',array('goodscate_cid'=>$_GET['goodscate_cid']))}'" value="返回"/>

	</form>
</body>
</html>